package rc.memory;

public class Account
{
	public int balance;

	public Account(int balance)
	{
		this.balance = balance;
	}

	public synchronized void add(int amount)
	{
		int newBalance;
		newBalance = balance;
		newBalance += amount;
		balance = newBalance;
	}

	public synchronized void remove(int amount)
	{
		int newBalance;
		newBalance = balance;
		newBalance -= amount;
		balance = newBalance;
	}

	public synchronized int getBalance()
	{
		return balance;
	}
}